﻿namespace JsonRpcService.Contract;

public interface IGreeterService
{
    Task<HelloResponse> SayHelloAsync(HelloRequest request);
}

public class GreeterService : IGreeterService
{
    public Task<HelloResponse> SayHelloAsync(HelloRequest request)
    {
        Console.WriteLine($"收到【{request.Name}】的问好，并回复了他");
        return Task.FromResult(new HelloResponse
        {
            Message = $"您好，{request.Name}！"
        });
    }
}
